Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Aug 11, 2025

Defining SplitPaths as a TAIT allows using closures instead of function pointers for split and map.

@rustbot
Copy link
Collaborator

rustbot commented Aug 11, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 11, 2025
@theemathas

This comment was marked as off-topic.

@theemathas

This comment was marked as off-topic.

@joboet
Copy link
Member Author

joboet commented Aug 11, 2025

Note that this does not concern the public SplitPaths, but rather the inner SplitPaths that is wrapped by it.

pub struct SplitPaths<'a> {
iter: iter::Map<slice::Split<'a, u8, fn(&u8) -> bool>, fn(&'a [u8]) -> PathBuf>,
}
pub type SplitPaths<'a> = impl Iterator<Item = PathBuf> + 'a;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these items be pub(crate) if so?

We'd rather not be exposing a TAIT to downstream code, I imagine, so it might be better to enforce that with proper visibility:

Suggested change
pub type SplitPaths<'a> = impl Iterator<Item = PathBuf> + 'a;
pub(crate) type SplitPaths<'a> = impl Iterator<Item = PathBuf> + 'a;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the items in sys is exposed publicly, but we still use pub instead of pub(crate) almost everywhere. I don't really want to break the pattern and cause unnecessary confusion.

@bors
Copy link
Collaborator

bors commented Aug 19, 2025

☔ The latest upstream changes (presumably #145489) made this pull request unmergeable. Please resolve the merge conflicts.

@Mark-Simulacrum
Copy link
Member

r=me

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@joboet
Copy link
Member Author

joboet commented Aug 29, 2025

@bors r=@Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

📌 Commit 85cefab has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 29, 2025
@bors
Copy link
Collaborator

bors commented Aug 29, 2025

⌛ Testing commit 85cefab with merge c180adc...

bors added a commit that referenced this pull request Aug 29, 2025
std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
@bors
Copy link
Collaborator

bors commented Aug 29, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 29, 2025
@joboet
Copy link
Member Author

joboet commented Aug 29, 2025

That's definitely spurious.
@bors r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

📌 Commit 85cefab has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Image input checksum 63a9e41071b3c3ad1fb0b603c94c8c10649e229cd0cf518479399112965ddbeaf3d6b6c5e3de88f5dc848f1dcf4a9c36010d1ee210f92e860529d0cd0e87ac2b
##[group]Building docker image for aarch64-gnu
Docker version 28.0.4, build b8034c0
Error response from daemon: Get "https://ghcr.io/v2/": Get "https://ghcr.io/token?account=rust-lang&client_id=docker&offline_token=true&service=ghcr.io": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
##[error]Process completed with exit code 1.
Post job cleanup.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 29, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 29, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 29, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
bors added a commit that referenced this pull request Aug 29, 2025
Rollup of 6 pull requests

Successful merges:

 - #144964 (std: clarify `OpenOptions` error for create without write access)
 - #145242 (std: use a TAIT to define `SplitPaths` on UNIX)
 - #145467 (Stabilize `strict_provenance_atomic_ptr` feature)
 - #145990 (`AutoDeref::final_ty` is already resolved)
 - #145991 (std: haiku: fix `B_FIND_PATH_IMAGE_PATH`)
 - #146000 (Improve librustdoc error when a file creation/modification failed)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 29, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 29, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 30, 2025
…mulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
bors added a commit that referenced this pull request Aug 30, 2025
Rollup of 9 pull requests

Successful merges:

 - #145242 (std: use a TAIT to define `SplitPaths` on UNIX)
 - #145467 (Stabilize `strict_provenance_atomic_ptr` feature)
 - #145756 (str: Stabilize `round_char_boundary` feature)
 - #145967 (compiler: Include span of too huge enum with `-Cdebuginfo=2`)
 - #145990 (`AutoDeref::final_ty` is already resolved)
 - #145991 (std: haiku: fix `B_FIND_PATH_IMAGE_PATH`)
 - #146000 (Improve librustdoc error when a file creation/modification failed)
 - #146017 (Mark pipe2 supported in Android)
 - #146022 (compiler-builtins subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 19ae976 into rust-lang:master Aug 30, 2025
10 of 11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 30, 2025
rust-timer added a commit that referenced this pull request Aug 30, 2025
Rollup merge of #145242 - joboet:tait-split-paths, r=Mark-Simulacrum

std: use a TAIT to define `SplitPaths` on UNIX

Defining `SplitPaths` as a TAIT allows using closures instead of function pointers for `split` and `map`.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 30, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#145242 (std: use a TAIT to define `SplitPaths` on UNIX)
 - rust-lang/rust#145467 (Stabilize `strict_provenance_atomic_ptr` feature)
 - rust-lang/rust#145756 (str: Stabilize `round_char_boundary` feature)
 - rust-lang/rust#145967 (compiler: Include span of too huge enum with `-Cdebuginfo=2`)
 - rust-lang/rust#145990 (`AutoDeref::final_ty` is already resolved)
 - rust-lang/rust#145991 (std: haiku: fix `B_FIND_PATH_IMAGE_PATH`)
 - rust-lang/rust#146000 (Improve librustdoc error when a file creation/modification failed)
 - rust-lang/rust#146017 (Mark pipe2 supported in Android)
 - rust-lang/rust#146022 (compiler-builtins subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Sep 1, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#145242 (std: use a TAIT to define `SplitPaths` on UNIX)
 - rust-lang/rust#145467 (Stabilize `strict_provenance_atomic_ptr` feature)
 - rust-lang/rust#145756 (str: Stabilize `round_char_boundary` feature)
 - rust-lang/rust#145967 (compiler: Include span of too huge enum with `-Cdebuginfo=2`)
 - rust-lang/rust#145990 (`AutoDeref::final_ty` is already resolved)
 - rust-lang/rust#145991 (std: haiku: fix `B_FIND_PATH_IMAGE_PATH`)
 - rust-lang/rust#146000 (Improve librustdoc error when a file creation/modification failed)
 - rust-lang/rust#146017 (Mark pipe2 supported in Android)
 - rust-lang/rust#146022 (compiler-builtins subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants